#ifndef __MY_TEST_H
#define __MY_TEST_H


#include "IOTCAPIs.h"
#include "AVAPIs.h"
#include "P2PCam/AVFRAMEINFO.h"
#include "P2PCam/AVIOCTRLDEFs.h"



typedef struct
{
   char *buf;
   int size;
   int ftype;
   void *pNext;
   void *pLast;
}BUFFERDATA_t;

#define SERVTYPE_STREAM_SERVER 0
#define MAX_CLIENT_NUMBER	128
#define MAX_SIZE_IOCTRL_BUF		1024
#define MAX_AV_CHANNEL_NUMBER	16

//#define MAX_BITRATE 600000
#define FPS 50   // Video FPS
//For DASA -- start
//#define DASA_ENABLED
#define DASA_HIGH_FPS           30
#define DASA_BTWHIGHNORMAL_FPS  20
#define DASA_NORMAL_FPS         15
#define DASA_BTWNORMALLOW_FPS   10
#define DASA_LOW_FPS            5

//#define ENABLE_EMULATER         1
//For DASA -- end

// *** AV server ID and password, set here ***


#define AUDIO_FORMAT_PCM  // modify this define for test which audio format

#ifdef AUDIO_FORMAT_PCM
#define AUDIO_FRAME_SIZE 320
#define AUDIO_FPS 40
#define AUDIO_CODEC 0x8C

#elif defined (AUDIO_FORMAT_ADPCM)
#define AUDIO_FRAME_SIZE 160
#define AUDIO_FPS 25
#define AUDIO_CODEC 0x8B

#elif defined (AUDIO_FORMAT_SPEEX)
#define AUDIO_FRAME_SIZE 38
#define AUDIO_FPS 56
#define AUDIO_CODEC 0x8D

#elif defined (AUDIO_FORMAT_MP3)
#define AUDIO_FRAME_SIZE 380
#define AUDIO_FPS 32
#define AUDIO_CODEC 0x8E

#elif defined (AUDIO_FORMAT_SPEEX_ENC)
#define AUDIO_FRAME_SIZE 160
#define AUDIO_ENCODED_SIZE 160
#define AUDIO_FPS 56



#endif

#define VIDEO_BUF_SIZE  (1024 * 300)
#define AUDIO_BUF_SIZE  1024

typedef struct _AV_Client
{
        int avIndex;
        unsigned char bEnableAudio;
        unsigned char bEnableVideo;
        unsigned char bEnableSpeaker;
        unsigned char bStopPlayBack;
        unsigned char bPausePlayBack;
        unsigned char bSendCache;
        int speakerCh;
        int playBackCh;
        //For DASA -- start
        int doCleanBuffer;
        int doCleanBufferDone;
        int waitKeyFrame;
        //For DASA -- end
        SMsgAVIoctrlPlayRecord playRecord;
        pthread_rwlock_t sLock;
}AV_Client;


#endif


